import 'package:flutter/material.dart';

import './tool_button_data.dart';

class ToolButtonWidget extends StatelessWidget {
  final ToolButtonData data;

  const ToolButtonWidget(this.data, {Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    var width = (MediaQuery.of(context).size.width - 20) / 3;
    return Container(
      width: width,
      child: GestureDetector(
        behavior:HitTestBehavior.translucent,
        onTap: () {
          if (data.onTapHandle != null) {
            data.onTapHandle(context);
          }
        },
        child: Column(
          children: [
            Icon(data.suffix,size: 24.0,),
            SizedBox(height: 10.0,),
            Text(data.title),
          ],
        ),
      ),
    );
    ;
  }
}
